<?php 
define('IN_QY',true);
session_start();
require("include/common.inc.php");
require_once("include/config.php");
require_once("include/httpUtil.php");
if(!$_COOKIE['userid']){
	$arr = array('error'=>1,'msg'=>'添加成功！');
	echo json_encode($arr);
}
$sql="select * from tbl_taospp where id=".$_POST['goodsid'];
$a=mysql_query($sql);
$rowa=mysql_fetch_array($a);

$money = $rowa['zswprice'];
//数量变更


	//$yuanexpore=$rowa['vipexpire'];
	//$time2=date('Y-m-d H:i:s',strtotime("+$time month",strtotime($yuanexpore)));
	
	// $sql="update tbl_user set viplevel=".$dji.",vipexpire='".$time2."' where id=".$_COOKIE['userid'];
    // mysql_query($sql);
	
	// 
	$sql="update tbl_user set yuee=yuee-".$money." where id=".$_COOKIE['userid'];
    mysql_query($sql);
	
    //入账				 
	$sqlyyq = "insert into tbl_vippay values (0,'".$_COOKIE['userid']."','".$money."','".$money."','".date('Y-m-d H:i:s')."',1)";
	 mysql_query($sqlyyq);	
	 
	//短信发送开始--支付成功了
$funAndOperate = "industrySMS/sendSMS";
// 生成body
$body = createBasicAuthData();
// 在基本认证参数的基础上添加短信内容和发送目标号码的参数
$body['smsContent'] = '【众晒网】亲爱的'.$_COOKIE['shuyu'].'，您已成功消费'.$money.'元，感谢您的支持';
$body['to'] = ''.$_COOKIE['username'].'';
$result = post($funAndOperate, $body);
 //短信发送结束 
	 
	 
	 
	$arr = array('error'=>0,'msg'=>'成功！');
	echo json_encode($arr);
